import {debounce} from 'common/utils'

export const itemListenerMixin = {
  mounted(){
    this.itemImgListener = ()=>{
      const refresh = debounce(this.$refs.scroll.refresh)
      refresh()
    }
    this.$bus.$on('itemImageLoad',this.itemImgListener)
  },
}

import BackTop from 'components/content/backTop/BackTop';

export const backTopMixin = {
  components:{
    BackTop
  },
  data(){
    return {
      IsBackTop: false,
    }
  },
  methods: {
    backClick(){
      this.$refs.scroll.scrollTo(0,0);
    },
    listenShowBackTop(position){
      this.IsBackTop = -position.y > 1000
    }
  }
}
